






var popup={
    init:function(contentHTML,width,height,initEvent){
        var html='<div class="pop—up-window"><div class="window-content"> ##contentHTML## </div></div>';
        //自动设置id
        html=html.replace("##contentHTML##",contentHTML);
        //构建出弹出节点
        var modelNode=jQuery(html);
        modelNode.appendTo(document.body);
        modelNode.css("display","none");

        var contentDiv=modelNode.find(".window-content");
        if(width){
            contentDiv.css("width",width);
        }
        if(height){
            contentDiv.css("height",height);
        }

        initEvent&&initEvent(contentDiv);

        var model={
                node:modelNode,
                show:function () {
                    model.node.css("display","block");
                },
                hide:function () {
                    model.node.css("display","none");
                },
                destroy:function () {
                    model.node.remove();
                    model=null;
                }
        };
        return model;
    }
};
